package client;

import java.nio.ByteBuffer;

public class FromServer {

	private final ByteBuffer info;
	
	public FromServer(byte[] b) {
		info = ByteBuffer.allocate(1024);
		info.put(b);
		info.flip();
		info.position(0);
	}

	public String getString() {
		byte b;
		ByteBuffer buff = ByteBuffer.allocate(1000);
		
		do{
			b = info.get();
			buff.put(b);
		}while(b != 0);
		
		buff.flip();
		byte[] array = buff.array();
		return new String(array, 0, array.length - 1);
	}

}
